#ifndef _DEF_H_
#define _DEF_H_

#include "stm32f10x.h"

typedef u8   	U8;   /*unsigned 8 bit definition */
typedef u16		U16;   /*unsigned 16 bit definition*/
typedef u32   	U32;   /*unsigned 32 bit definition*/
typedef signed char     	S8;   /*signed 8 bit definition */
typedef short signed int	S16;   /*signed 16 bit definition*/
typedef long int    	 	S32;   /*signed 32 bit definition*/

typedef u8		uint8;   /*unsigned 8 bit definition */
typedef u16		uint16;   /*unsigned 16 bit definition*/
typedef u32		uint32;   /*unsigned 32 bit definition*/
//typedef signed char			s8;   /*signed 8 bit definition */
//typedef signed short int		s16;   /*signed 16 bit definition*/
//typedef signed long int		s32;   /*signed 32 bit definition*/

typedef u8   	tU08;   /*unsigned 8 bit definition */
typedef unsigned short int	tU16;   /*unsigned 16 bit definition*/
typedef unsigned long		tU32;   /*unsigned 32 bit definition*/
typedef signed char			tS08;   /*signed 8 bit definition */
typedef short signed int	tS16;   /*signed 16 bit definition*/
typedef signed long int		tS32;   /*signed 32 bit definition*/

typedef unsigned char  BYTE;
typedef unsigned int   UINT;
typedef unsigned short WORD;
typedef unsigned short UINT16;
typedef unsigned long  UINT32;
typedef unsigned long  DWORD;
typedef unsigned long  ULONG;

typedef float FLOAT;
typedef double DOUBLE;

typedef u8   BOOL;
typedef int   INT;
typedef float FLOAT;

typedef U8	 uint8_t;
typedef U16  uint16_t;
typedef U32  uint32_t;
typedef S8	 int8_t;
typedef S16  int16_t;
//typedef S32  int32_t;

#define NOP()         ;

#define STRUCT_OFFSET(stru_name, element) (unsigned long)&((struct stru_name*)0)->element

struct struct_basedata {
	BOOL debugMsgOn;
	BOOL debugUartOverflow;
};

	#define T_1MS         (1)
	#define T_1S          (T_1MS*1000)


/******************************************************************************
Common Bit masks
******************************************************************************/
/*
#define BIT0    0x01    
#define BIT1    0x02
#define BIT2    0x04
#define BIT3    0x08
#define BIT4    0x10
#define BIT5    0x20
#define BIT6    0x40
#define BIT7    0x80
*/

#endif
